package com.bytenerd.common.exception;


import com.bytenerd.common.enums.ResponseCode;
import lombok.Getter;

/**
 * author bytenerd
 */
@Getter
public class BizException extends RuntimeException{
    private final Integer code;

    private final String msg;

    public BizException(Integer code,String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BizException(ResponseCode responseCode){
        super(responseCode.getMsg());
        this.code = responseCode.getCode();
        this.msg = responseCode.getMsg();
    }
}
